package builder;

import java.util.Vector;

import model.Action;

public class ChainOfResponsabilityBuilder extends AbstractPatternBuilder {

	private String client = "Client";
	private String handler = "Handler";
	private String concreteHandler1 = "ConcreteHandler1";
	private String concreteHandler2 = "ConcreteHandler1";

	public ChainOfResponsabilityBuilder() {
		super();
	}

	@Override
	public Vector<Action> buildPattern() {
		
		this.buildClass(concreteHandler1);
		this.buildClass(concreteHandler2);
		
		this.buildAbstractClass(client);
		this.buildAbstractClass(handler);
				
		this.buildAssociation(handler, handler);
		this.buildAssociation(client, handler);
		
		this.buildGeneralization(concreteHandler1, handler);
		this.buildGeneralization(concreteHandler2, handler);
				
		return patternActions;
	}

	@Override
	public void changeNames() {
		
		client = names.get(0);
		handler = names.get(1);
		concreteHandler1 = names.get(2);
		concreteHandler2 = names.get(3);
		
	}
	
	@Override
	public int cantUMLElements() {
		return 4;
	}

}
